package cn.gson.springboot.model.service;

import cn.gson.springboot.model.dao.TracelogDao;
import cn.gson.springboot.model.mapper.TracelogMapper;
import cn.gson.springboot.model.pojos.Tracelog;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class TracelogService {
    @Autowired
    TracelogMapper traMapper;
    @Autowired
    TracelogDao traDao;

    public List<Tracelog> selectTrace(Integer oppId){
        return traMapper.selectTrace(oppId);
    }

    @Transactional(transactionManager = "transactionManager")
    public void saveTrace(Tracelog trace){
        traDao.save(trace);
    }
}
